﻿<%@ Page MasterPageFile="~/MasterPage.master" Language="C#" AutoEventWireup="true" CodeFile="ManageUsers.aspx.cs" Inherits="ManageUsers" %>

<asp:Content ID="content1" runat="server" ContentPlaceHolderID="MainContentPlaceHolder">
    <div>
    
        <table style="width:100%;">
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" 
                        AutoGenerateRows="False" CellPadding="4" DataKeyNames="id" 
                        DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" 
                        Height="50px" Width="125px">
                        <AlternatingRowStyle BackColor="White" />
                        <CommandRowStyle BackColor="#FFFFC0" Font-Bold="True" />
                        <FieldHeaderStyle BackColor="#FFFF99" Font-Bold="True" />
                        <Fields>
                            <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" 
                                SortExpression="id" InsertVisible="False" />
                            <asp:BoundField DataField="username" HeaderText="username" 
                                SortExpression="username" />
                            <asp:BoundField DataField="password" HeaderText="password" 
                                SortExpression="password" />
                            <asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
                            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                                ShowInsertButton="True" />
                        </Fields>
                        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                    </asp:DetailsView>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:PAS_DB %>" 
                        DeleteCommand="DELETE FROM [homelogin] WHERE [uname] = @uname" 
                        InsertCommand="INSERT INTO [homelogin] ([uname], [upassword]) VALUES (@uname, @upassword)" 
                        SelectCommand="SELECT * FROM [homelogin]" 
                        UpdateCommand="UPDATE [homelogin] SET [upassword] = @upassword WHERE [uname] = @uname">
                        <DeleteParameters>
                            <asp:Parameter Name="uname" Type="String" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="uname" Type="String" />
                            <asp:Parameter Name="upassword" Type="String" />
                        </InsertParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="upassword" Type="String" />
                            <asp:Parameter Name="uname" Type="String" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    
    </div>
 </asp:Content>